# Contributor: Guy Godfroy <guy.godfroy@gugod.fr>
# Maintainer: Guy Godfroy <guy.godfroy@gugod.fr>
pkgname=greetd-regreet
pkgver=0.1.1
pkgrel=0
pkgdesc="Clean and customizable GTK4 based greeter for greetd"
url="https://github.com/rharish101/ReGreet"
# s390x, riscv64: greetd
# armhf: fails to build
# loongarch64: blocked by libc crate
arch="all !armhf !s390x !riscv64 !loongarch64"
license="GPL-3.0-or-later"
depends="greetd"
makedepends="cargo gtk4.0-dev cargo-auditable"
source="$pkgname-$pkgver.tar.gz::https://github.com/rharish101/ReGreet/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/ReGreet-$pkgver"

_cargo_opts="--frozen --features gtk4_8"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build $_cargo_opts --release
}

check() {
	cargo test $_cargo_opts
}

package() {
	install -Dm755 target/release/regreet "$pkgdir"/usr/bin/regreet
}

sha512sums="
c2276c9ee3699974a5ebdefe811bfdb15d5642f6d3d20f6ea6b4f5ce3b40a9691ed42441e50f506a503ef523b894ff28d1746844b26bc32dff5db18a1d5e8150  greetd-regreet-0.1.1.tar.gz
"
